let line = " aabcsdsa";
let map = new Map();
for (let i of line) {
  map.set(i, map.get(i) ? map.get(i) + 1 : 1);
}
let max = 0;
let maxval;
for (let [val, count] of map) {
  console.log(val, count);
  if (count > max) {
    maxval = val;
    max = count;
  }
}
console.log(maxval);
